﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;

namespace WcfServiceSchool
{
    [ServiceContract]
    public interface IServiceSchool
    {
        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "subjects/{className}")]
        List<SubjectDTO> GetSubjects(string className);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "students/{className}")]
        List<StudentDTO> GetStudents(string className);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "addclass/{className}")]
        string AddClass(string className);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "deleteclass/{className}")]
        string DeleteClass(string className);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "addstudent/{studentName}")]
        string AddStudent(string studentName);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "editstudent/{studentName}/newname/{newName}")]
        string EditStudent(string studentName, string newName);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "deletestudent/{studentName}")]
        string DeleteStudent(string studentName);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "addstudenttoclass/{studentName}/{className}")]
        string AddStudentToClass(string studentName, string className);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "removestudentfromclass/{studentName}")]
        string RemoveStudentFromClass(string studentName);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "addsubject/{subjectName}")]
        string AddSubject(string subjectName);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "editsubject/{subjectName}/newname/{newName}")]
        string EditSubject(string subjectName, string newName);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "deletesubject/{subjectName}")]
        string DeleteSubject(string subjectName);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "addsubjecttoclass/{subjectName}/{className}")]
        string AddSubjectToClass(string subjectName, string className);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "removesubjectfromclass/{subjectName}/{className}")]
        string RemoveSubjectFromClass(string subjectName, string className);

        [OperationContract]
        [WebInvoke(Method = "GET", UriTemplate = "subjects/all")]
        List<SubjectDTO> GetAllSubjects();
    }
}
